package Library.Game;

import java.rmi.*;
import java.util.*;
import Library.*;
import Library.Login.*;

/**
 * //TODO: [LIBRARY#05] [JAVADOC] javadoc missing
 */
public interface IGame //NOTE: NOT REMOTE
{
    //TODO: [LIBRARY#06] [CHECK] RemoteExceptions needed here?
    /**
     * Eindig de beurt van de speler
     * @param curPlayer 
     * @return void
     * @throws Exception
     */
    int changeTurn(ISession curPlayer) throws Exception;

    /**
     * Haalt een lijst met alle spelers in deze game op
     * @return Lijst_Met_Spelers
     * @throws RemoteException
     * @throws Exception
     */
    List<IPlayer> getPlayers() throws RemoteException, Exception;

    /**
     *
     * @return
     * @throws RemoteException
     */
    int getMaxPlayers() throws RemoteException;
    
    /**
     * Join deze game
     * @param player Ticket object van de speler die de game joined
     * @param callback 
     * @return Sessie
     * @throws RemoteException
     * @throws Exception
     */
    //ISession join(ITicket player) throws RemoteException, Exception;
    ActionResult<ISession> join(ITicket player, IClientService callback) throws RemoteException, Exception;

    /**
     * Verlaat het spel
     * @param player Speler die het spel verlaat
     * @throws RemoteException
     * @throws Exception
     */
    void leave(ISession player) throws RemoteException, Exception;
    
    /**
     * Geeft de naam van de game terug
     * @return gamenaam
     * @throws RemoteException
     */
    String getName() throws RemoteException;
    
    /**
     * Geeft de gameinformatie terug
     * #return gameinformatie
     * @return
     * @throws RemoteException
     */
    IGameInfo getInfo() throws RemoteException;
    
    //TODO: hier nog javadoc
    
    /**
     *
     * @param player
     * @return
     * @throws RemoteException
     * @throws Exception
     */
    boolean start(ISession player) throws RemoteException, Exception;
    /**
     *
     * @param session
     * @param landID1
     * @param landID2
     * @param amount
     * @return
     * @throws RemoteException
     * @throws Exception
     */
    int attack(ISession session, int landID1, int landID2, int amount) throws RemoteException, Exception;
    /**
     *
     * @param message
     * @throws RemoteException
     * @throws Exception
     */
    void sendGlobalMessage(String message) throws RemoteException, Exception;

    /**
     *
     * @param session
     * @param decission
     * @return
     * @throws RemoteException
     * @throws Exception
     */
    int turnDecission(ISession session, int decission) throws RemoteException, Exception;
    /**
     *
     * @param session
     * @param landID
     * @param amount
     * @return
     * @throws RemoteException
     * @throws Exception
     */
    int reinforce(ISession session, int landID, int amount) throws RemoteException, Exception;
    /**
     *
     * @param session
     * @param amount
     * @return
     * @throws RemoteException
     * @throws Exception
     */
    int defend(ISession session, int amount) throws RemoteException, Exception;
    
    String getGameWinner() throws RemoteException, Exception;
}
